class Yh():
    def __init__(self,id,password,name,balance):
        self.id=id
        self.password=password
        self.name=name
        self.balance=balance

    def take_money(self,S):
        a=self.balance+S


        print( "余额:%d元,存款:%d元,存款后余额%d元" % (self.balance, S, a))
        self.balance = a

    def takes_money(self,S):
        a=self.balance-S


        print( "余额:%d元,取款:%d元,取款后余额%d元" % (self.balance, S, a))
        self.balance = a
quqian=Yh(123,int(input("密码:")),"小明",1000)
quqian.take_money(50)
quqian.takes_money(100)
quqian.take_money(200)
quqian.takes_money(250)
